package com.acp.controller;

import com.acp.param.DcsHistoricalAreaParam;
import com.acp.result.ResultInfo;
import com.acp.service.DcsHistoricalAreaService;
import com.acp.util.BeanValidator;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * All rights Reserved, Designed By 姑苏区政府大数据中心
 *
 * @version V1.0
 * @Title: null.java
 * @Package com.dci.controller.construction
 * @Description: 历史地段数据管理
 * @author: 张星亮
 * @date: 2019/4/5
 * @Copyright: 2019 姑苏区政府大数据中心. All rights reserved.
 * 注意：本内容仅限于姑苏区政府大数据中心内部传阅，禁止外泄以及用于其他的商业目
 */

@Controller
@RequestMapping("/historicalArea")
public class DcsHistoricalAreaController {
    @Resource
    private DcsHistoricalAreaService dcsHistoricalAreaService;

    /**
     * 新增
     *
     * @param dcsHistoricalAreaParam
     * @return ResultInfo 封装的返回参数  保存成功msg:906 保存失败msg:911
     * @throws Exception
     */
    @PostMapping("/addHistoricalArea")
    @ResponseBody
    @ApiOperation(value = "新增", notes = "新增")
    @ApiImplicitParam(paramType = "body", name = "dcsHistoricalAreaParam", value = "编码", required = true, dataType = "DcsHistoricalAreaParam")
    public ResultInfo addHistoricalArea(@RequestBody DcsHistoricalAreaParam dcsHistoricalAreaParam) {
        BeanValidator.check(dcsHistoricalAreaParam);
        return dcsHistoricalAreaService.addHistoricalArea(dcsHistoricalAreaParam);
    }
}
